﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 教室实体，带审计和软删除。
    /// </summary>
    [Table("Basic_Schools")] //对应数据库的表名，建议规则：模块名+实体名。
    public class School : FullAuditedEntity<Guid>, IMustHaveTenant
    {
        public const int MaxNameLength = 50;
        public const int MaxCodeLength = 50;
        public const int MaxManagerLength = 50;
        public const int MaxAddressLength = 100;
        public const int MaxRemarkLength = 500;

        public int TenantId { get; set; }

        /// <summary>
        /// 学校名称
        /// </summary>
        [Required]//字段必填
        [MaxLength(MaxNameLength)]
        public virtual string SchoolName { get; set; }
        /// <summary>
        /// 学校编码
        /// </summary>
        [MaxLength(MaxCodeLength)]
        public virtual string SchoolCode { get; set; }
        /// <summary>
        /// 组织类型 1：学校 2：部门
        /// </summary>
        public virtual int OrgType { get; set; }
        /// <summary>
        /// 联系方式
        /// </summary>
        public virtual string OfficePhone { get; set; }
        /// <summary>
        /// 父节点
        /// </summary>
        public Guid? ParentId { get; set; }
        /// <summary>
        /// 负责人
        /// </summary>
        [MaxLength(MaxManagerLength)]
        public virtual string Manager { get; set; }
        /// <summary>
        /// 职能ID
        /// </summary>
        public Guid? FunctionId { get; set; }
        /// <summary>
        /// 职能名称
        /// </summary>
        [MaxLength(MaxNameLength)]
        public virtual string FunctionName { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [MaxLength(MaxAddressLength)]
        public virtual string Address { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(MaxRemarkLength)]
        public virtual string Remark { get; set; }
    }
}
